package com.small.nine.wxmp.domain.bean.wx.kf.msg;

import com.small.nine.wxmp.common.constant.WxConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.Map;

/**
 * 客服返回 图片信息
 *
 * @author sheng_zs@126.com
 * @date 2021-08-06 17:00
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class WxKfImageMsgBean extends WxKfMsgBaseBean {
    private static final long serialVersionUID = 1L;

    /**
     * 图片内容
     */
    private Map<String, String> image;

    /**
     * 初始化，并返回
     *
     * @param toUser  发送对象
     * @param mediaId 图片 ID
     * @return {@link WxKfImageMsgBean}
     */
    public static WxKfImageMsgBean getInstance(String toUser, String mediaId) {
        WxKfImageMsgBean msgBean = new WxKfImageMsgBean();
        msgBean.setToUser(toUser);
        msgBean.setMsgType(WxConstant.MSG_TYPE_IMAGE);
        // 图片信息
        Map<String, String> map = new HashMap<>();
        map.put(WxConstant.PARAM_MEDIA_ID, mediaId);
        msgBean.setImage(map);
        return msgBean;
    }
}
